@font-face {
  font-family: Comic-Jens;
  src: url(\\src\\ComicJensFreePro-Regular.ttf);
}


:root {
  --white: #979797;
  --grey: #575757;
  --black: #050505;
  --red: #ff7070;
  --light-green: #9fff9c;
  --light-red: #ff9c9c;

  --listColour: #B7B7AF;
  --lineColour: #526D82;
  --penColour: #233a4b;

  --fruit: #095e1b;
  --meat: #db3838;
  --deli: #f0c91d;
  --aisles: #3ebcc0;
  --dairy: #4851c9;
  --baby: #c948c2;
  --freezer: #00098b;

  --border-radius: 8px;
  --spacing-xs: 5px;
  --spacing-sm: 10px;
  --spacing-md: 15px;
  --spacing-lg: 20px;
  --spacing-xl: 40px;
  --container-width: 1200px;
  --shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
}

/* CSS RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  /* footer support */
  position: relative;
  min-height: 100%;
}

body {
  /* background: linear-gradient(330deg in hsl, blue, red 50%, blue 50%, red); */
  color: var(--black);
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 500;
  word-wrap: break-word;
  /* footer support */
  margin-bottom: 100px;
}

button,
input {
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  outline: none;
}

input[type='text'],
input[type='number'] {
  cursor: text;
}

input[type='submit'] {
  display: none;
}

/* UTILS */

.container {
  max-width: var(--container-width);
  padding: var(--spacing-lg);
  margin: 0 auto;
}

.btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius);
  transition: filter 0.15s ease-in-out;
}

.btn:hover {
  filter: brightness(90%);
}

.btn-add {
  font-size: 24px;
  font-weight: 600;
}

.btn-light-green {
  background-color: var(--light-green);
}

.btn-light-red {
  background-color: var(--light-red);
}

/* HEADER */

.header {
  background-color: var(--white);
  box-shadow: var(--shadow);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logged-in,
.logged-out {
  display: none;
}

.logged-in.active,
.logged-out.active {
  display: flex;
  gap: 20px;
}

/* MAIN */
.main {
  margin-top: var(--spacing-lg);
  text-align: center;
}

#newListBtn {
  margin-bottom: 35px;
}

.shopping-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  background-color: var(--white);
  border: 1px solid var(--listColour);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 0 auto;
}

.strikthrough {
  text-decoration: line-through;
  position: absolute;
  content: '';
  width: 100%;
  /* height: 1px; */
  background-color: var(--grey);
  top: 50%; /* Position at the center of the item */
  /* transform: translateY(-50%); */
}

.item {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--listColour);
  cursor: pointer;
  position: relative; /* Added position relative */
}

.item-name {
  flex: 4;
  font-family: 'Comic-Jens', cursive;
  color: var(--penColour);
  text-transform: capitalize;
  margin-left: 10px;
  text-align: left;
}

.item-amount {
  flex: 1;
  font-family: 'Comic-Jens', cursive;
  color: var(--penColour);
}

.item-category {
  flex: 1;
  border-radius: 12px;
  text-transform: lowercase;
  font-size: 16px;
  font-family: 'Arial', Helvetica, sans-serif;
  color: var(--black);
  margin-right: 10px;
  text-align: center;
}

.cat-fruit {
  background-color: var(--fruit);
}

.cat-meat {
  background-color: var(--meat);
}

.cat-deli {
  background-color: var(--deli);
  color: var(--black);
}

.cat-aisles {
  background-color: var(--aisles);
  color: var(--black);
}

.cat-dairy {
  background-color: var(--dairy);
}

.cat-baby {
  background-color: var(--baby);
  color: var(--black);
}

.cat-freezer {
  background-color: var(--freezer);
}


/* MODALS */
.modal {
  position: fixed;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 300px;
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  background-color: var(--white);
  text-align: center;
  transform: translate(-50%, -50%) scale(0);
  transition: 0.2s ease-in-out;
  box-shadow: var(--shadow);
}

form {
  display: flex;
  flex-direction: row;
}

.modal.active {
  transform: translate(-50%, -50%) scale(1);
}

input {
  width: 100%;
  padding: 10px;
  border-radius: var(--border-radius);
  display: inline-block;
  background-color: var(--white);
  font-size: 16px;
}

.input-name {
  flex: 4;
  font-family: cursive;
  margin-left: 10px;
}

.input-amount {
  flex: 1;
  text-align: center;
}

.input-category {
  flex: 1;
  margin-right: 25px; 
  font-family: 'Arial', Helvetica, sans-serif;
  padding: 10px;
  font-size: 16px;
  border-radius: 20px;
  background-color: var(--listColour);
}

.checkbox {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  accent-color: white;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.overlay.active {
  display: block;
}

/* LOADING RING */
.lds-dual-ring {
  display: none;
  margin: 20px auto;
}

.lds-dual-ring:after {
  content: ' ';
  display: block;
  width: 30px;
  height: 30px;
  margin: 8px;
  border-radius: 50%;
  border: 3px solid var(--black);
  border-color: var(--black) transparent var(--black) transparent;
  animation: lds-dual-ring 1.2s linear infinite;
}

.lds-dual-ring.active {
  display: block;
}

@keyframes lds-dual-ring {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}